#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

import os

def get_sql(file:str)->list:
    file = os.path.abspath(file)
    if not os.path.exists(file):
        print(f"{file} is not invalid.")
        return None
    
    with open(file,'r') as f:
        command=str()
        lines = f.readlines()
        for line in lines:
            if line.startswith('-'):
                continue
            command=command+' '+line.strip()
    cmds = command.split(';')
    ret = []
    for c in cmds:
        if len(c)==0:
            continue
        ret.append(c)
    return ret

if __name__=='__main__':
    ret = get_sql("../sql/steps/0_CompressSymbolUse.sql")
    print(ret)